using System;
using System.Collections.Generic;
using System.Text;

namespace TK3DSim.Other
{
    public class Range
    {
        private Location _LeftTop=null;
        private Location _RightBottom =null;

        public Range(Location lefttop, Location rightbottom)
        {
            _LeftTop = lefttop;
            _RightBottom = rightbottom;
        }

        public Range(string rangestring)
        {
            int iNO=rangestring.IndexOf("|");
            _LeftTop = new Location(rangestring.Substring(0, iNO));
            _RightBottom = new Location(rangestring.Substring(iNO + 1));
        }

        public Range Clone()
        {
            Range ran = new Range(this.ToString());
            return ran;
        }

        public Range()
        {
            _LeftTop=new Location();
            _RightBottom = new Location();
        }

        public Location LeftTopPoint
        {
            get { return _LeftTop; }
        }

        public Location RightBottom
        {
            get { return _RightBottom; }
        }

        public override string ToString()
        {
            return _LeftTop.ToString()+"|"+_RightBottom.ToString();
        }
    
    }
}
